import request from '@/utils/request'

// 添加维保合同
export function miContAdd(data) {
  return request({
    url: '/maintenance/miContract/add',
    method: 'post',
    params: {},
    data,
    port: { ENV_PORT: 8005 },
    ajaxType2: 'reqPost'
    // ajaxType: 'formdata'
  })
}

// 删除维保合同
export function miContDelete(id) {
  return request({
    url: '/maintenance/miContract/delete',
    method: 'delete',
    params: { id },
    port: { ENV_PORT: 8005 },
    ajaxType2: 'reqDelete'
  })
}

// 查询维保合同列表
export function miContQueryList(contractNumber, pageIndex, pageSize, userUnitId) {
  return request({
    url: '/maintenance/miContract/queryList',
    method: 'get',
    params: { contractNumber, pageIndex, pageSize, userUnitId },
    port: { ENV_PORT: 8005 },
    ajaxType2: 'reqGet'
  })
}

// 修改维保合同
export function miContUpdate(data) {
  return request({
    url: '/maintenance/miContract/update',
    method: 'put',
    params: {},
    data,
    port: { ENV_PORT: 8005 },
    ajaxType2: 'reqPut'
    // ajaxType: 'formdata'
  })
}

// 维保合同详情
export function miContDetail(contractId) {
  return request({
    url: '/maintenance/miContract/detail',
    method: 'get',
    params: { contractId },
    port: { ENV_PORT: 8005 },
    ajaxType2: 'reqGet'
  })
}

